<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title></title>
  </head>
  <body>
    <div id="app">
      <router-link to="/">去首页</router-link>
      <router-link to="/login">去登录页</router-link>
      <router-link to="/content">去内容页</router-link>
      <router-view></router-view>
    </div>
    <script src="./vue.js"></script>
    <script src="./vue-router.min.js"></script>
    <script>
      const routes=[
        {
          path:"/",component:{template:"<div>首页</div>"}
        },
        {
          path:"/login",component:{template:"<div>登录页</div>"}
        },
        {
          path:"/content",component:{template:"<div>内容</div>"}
        },
      ]
      const router=new VueRouter({routes})

      const vm=new Vue({
        el:'#app',
        data:{},
        methods:{},
        router
       })
    </script>
  </body>
</html>